package com.bk.bands.template;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.bk.bands.common.Color;
import com.bk.bands.template.xmladapter.ColorAdapter;
import com.bk.bands.model.Style;


@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
@XmlType(name = "style", namespace = "http://com.bk.docs", propOrder = {
    "name",
    "textColor",
    "horAlign",
    "verAlign",
    "font"
})
public class XmlStyle {


   private Style style;

   public XmlStyle(Style style)
   {
      this.style = style;
   }

   public XmlStyle()
   {
      this.style = new Style();
   }

   public Style getStyle()
   {
      return style;
   }

   @XmlAttribute(required = true, name = "name")
    public String getName() {
        return style.getName();
    }

    public void setName(String styleName) {
        style.setName(styleName);
    }

    @XmlSchemaType(name = "string")
    @XmlJavaTypeAdapter(type=String.class,value=ColorAdapter.class)
    @XmlElement(namespace = "http://com.bk.docs", required = true)
    public Color getTextColor() {
        return style.getTextColor();
    }

    public void setTextColor(Color value) {
        style.setTextColor(value);
    }

    @XmlElement(namespace = "http://com.bk.docs", required = true)
    public HorizontalAlign getHorAlign() {
        return style.getHorAlign();
    }

    public void setHorAlign(HorizontalAlign value) {
        style.setHorAlign(value);
    }

    @XmlElement(namespace = "http://com.bk.docs", required = true)
    public VerticalAlign getVerAlign() {
        return style.getVerAlign();
    }

    public void setVerAlign(VerticalAlign value) {
        style.setVerAlign(value);
    }

    @XmlElement(namespace = "http://com.bk.docs", required = true)
    public XmlFont getFont() {
        return new XmlFont(style.getFont());
    }

    public void setFont(XmlFont value) {
        style.setFont(value.getFont());
    }

}
